package net.neptech.controller;

import net.neptech.model.information.InforTech;
import net.neptech.service.InforTechService;
import net.neptech.vm.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 谢辉
 * @Date 2025/8/21 11:58
 * @Description 特色医疗技术新闻表
 **/

@RestController
@RequestMapping("/information/inforTech")
public class InforTechContorller {

    @Autowired
    private InforTechService inforTechService;

    /**
     * 新增特色医疗技术新闻
     */
    @PostMapping("/addInforTech")
    public ResponseResult addInforTech(@RequestBody InforTech inforTech) {
        inforTechService.addInforTech(inforTech);
        return ResponseResult.success();
    }

    /**
     * 删除特色医疗技术新闻
     */
    @DeleteMapping("/{id}")
    public ResponseResult deleteInforTech(@PathVariable("id") Long id) {
        inforTechService.deleteInforTech(id);
        return ResponseResult.success();
    }

    /**
     * 查询全部特色医疗技术新闻
     */
    @GetMapping()
    public ResponseResult getInforTech() {
        return ResponseResult.success(inforTechService.getInforTech());
    }

    /**
     * 修改特色医疗技术新闻
     */
    @PutMapping("updateInforTech")
    public ResponseResult updateInforTech(@RequestBody InforTech inforTech) {
        inforTechService.updateInforTech(inforTech);
        return ResponseResult.success();
    }

    /**
     * 根据id查询特色医疗技术新闻
     */
    @GetMapping("/{id}")
    public ResponseResult getInforTechById(@PathVariable("id") Long id) {
        return ResponseResult.success(inforTechService.getInforTechById(id));
    }
}
